class SubContractor < ActiveRecord::Base
  attr_accessible :name, :official_url, :principal, :logo_url, :description, :project_count
  
  has_and_belongs_to_many   :tags, 
                            :join_table   => "tagged_items", 
                            :foreign_key  => "taggable_id", 
                            :conditions   => "taggable_type = '#{self.class_name}'", 
                            :insert_sql   => 'INSERT INTO tagged_items (taggable_id,tag_id,taggable_type) VALUES (#{id}, #{record.id}, \'#{self.class}\');',
                            :after_add    => :increment_tag_count, 
                            :after_remove => :decrement_tag_count
  has_many :tasks                            
end
